//% color="#00ff00" iconWidth=50 iconHeight=40
    namespace SFA40HCHO{
    //% block="Init SFA40" blockType="command"
    export function myBlock0(parameter: any, block: any) {
        Generator.addInclude("myBlock4249",`#include "DFRobot_SFA40.h"`)
        Generator.addObject("myBlock2069",`DFRobot_SFA40 SFA40`,"")
        Generator.addSetup("myBlock8780",`while(SFA40.begin()!=0){delay(1000);} `)
        Generator.addSetup("myBlock8781",`SFA40.startMeasurement();`)
    }

    //% block="SFA40 measure once" blockType="command"
    export function myBlock1(parameter: any, block: any) {
        Generator.addInclude("myBlock4249",`#include "DFRobot_SFA40.h"`)
        Generator.addObject("myBlock2069",`DFRobot_SFA40 SFA40`,"")
        Generator.addSetup("myBlock8780",`while(!SFA40.begin()){delay(1000);} `)
        Generator.addSetup("myBlock8781",`SFA40.startMeasurement();`)
        Generator.addCode(`SFA40.readMeasurementData();`)
    }

    //% block="get SFA40 [mode]" blockType="reporter"
    //% mode.shadow="dropdown" mode.options="mode" 
    export function myBlock2(parameter: any, block: any) {
        let mode= parameter.mode.code
        Generator.addInclude("myBlock4249",`#include "DFRobot_SFA40.h"`)
        Generator.addObject("myBlock2069",`DFRobot_SFA40 SFA40`,"")
        Generator.addSetup("myBlock8780",`while(!SFA40.begin()){delay(1000);} `)     
        Generator.addSetup("myBlock8781",`SFA40.startMeasurement();`)  
        Generator.addCode(`SFA40.${mode}`)
    }
}